package kku.cs.fgl.cursor;

import java.io.IOException;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.particles.ParticleSystem;
import org.newdawn.slick.particles.effects.FireEmitter;

import kku.cs.fgl.Cursor;

public class FireCursor extends Cursor {
    ParticleSystem fire;
    
	public FireCursor(int n) {
		super(n);
	}

	public FireCursor(String imageFile) {
		super(imageFile);
	}

	public FireCursor(String imageFile, Color tranColor) {
		super(imageFile, tranColor);
	}

	public FireCursor(Image img) {
		super(img);
	}

	public FireCursor(String imageFile, float x, float y) throws IOException {
		super(imageFile, x, y);
	}

	public FireCursor(Image img, float x, float y) {
		super(img, x, y);
	}

	public void paint(Graphics g) {
		if(fire!=null) fire.render(cx,cy);
		super.paint(g);
	}

	public void update(int time) {
		if(fire==null){
			fire = new ParticleSystem("particle.png",20);
			FireEmitter f=new FireEmitter(0,0,5);			
			fire.addEmitter(f);	
		}
		super.update(time);
		fire.update(time);
	}
    
}
